package com.ruoyi.system.domain;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 聊天记录对象 app_chat_record
 *
 * @author ruoyi
 * @date 2023-04-04
 */
public class AppChatRecord extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * $column.columnComment
     */
    private Long id;

    /**
     * 状态，0：正常，1：冻结
     */
    @Excel(name = "状态，0：正常，1：冻结")
    private Long state;

    /**
     * 回调命令
     */
    @Excel(name = "回调命令")
    private String callbackCommand;

    /**
     * 发送者
     */
    @Excel(name = "发送者")
    private String fromAccount;

    /**
     * 接收者
     */
    @Excel(name = "接收者")
    private String toAccount;

    /**
     * 消息序列号
     */
    @Excel(name = "消息序列号")
    private Long msgSeq;

    /**
     * 消息随机数
     */
    @Excel(name = "消息随机数")
    private Long msgRandom;

    /**
     * 消息的发送时间戳，单位为秒
     */
    @Excel(name = "消息的发送时间戳，单位为秒 ")
    private Long msgTime;

    /**
     * 消息的唯一标识，可用于 REST API 撤回单聊消息
     */
    @Excel(name = "消息的唯一标识，可用于 REST API 撤回单聊消息")
    private String msgKey;

    /**
     * 是否仅发送给在线用户标识。1代表仅发送给在线用户，否则为0；
     */
    @Excel(name = "是否仅发送给在线用户标识。1代表仅发送给在线用户，否则为0；")
    private Long onlineOnlyFlag;

    /**
     * 该条消息的下发结果
     */
    @Excel(name = "该条消息的下发结果")
    private Long sendMsgResult;

    /**
     * 该条消息下发失败的错误信息，若消息发送成功，则为"send msg succeed"
     */
    @Excel(name = "该条消息下发失败的错误信息，若消息发送成功，则为")
    private String errorInfo;

    /**
     * To_Account 未读的单聊消息总数量
     */
    @Excel(name = "To_Account 未读的单聊消息总数量")
    private Long unreadMsgNum;

    /**
     * 消息体
     */
    @Excel(name = "消息体")
    private String msgBody;

    /**
     *消息体msgBodyJson
     */
    @TableField(exist = false)
    private JSONArray msgBodyJson;


    public JSONArray getMsgBodyJson() {
        return msgBodyJson;
    }

    public void setMsgBodyJson(JSONArray msgBodyJson) {
        this.msgBodyJson = msgBodyJson;
    }

    /**
     * 消息类型
     */
    @TableField(exist = false)
    private String msgType;


    public String getMsgType() {
        return msgType;
    }

    public void setMsgType(String msgType) {
        this.msgType = msgType;
    }

    public String getStartDate() {
        return startDate;
    }

    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }

    public String getEndDate() {
        return endDate;
    }

    public void setEndDate(String endDate) {
        this.endDate = endDate;
    }

    /**
     * 查询字段
     */
    @TableField(exist = false)
    private String startDate;
    /**
     * 查询字段
     */
    @TableField(exist = false)
    private String endDate;



    /**
     * $column.columnComment
     */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String cloudCustomData;

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setState(Long state) {
        this.state = state;
    }

    public Long getState() {
        return state;
    }

    public void setCallbackCommand(String callbackCommand) {
        this.callbackCommand = callbackCommand;
    }

    public String getCallbackCommand() {
        return callbackCommand;
    }

    public void setFromAccount(String fromAccount) {
        this.fromAccount = fromAccount;
    }

    public String getFromAccount() {
        return fromAccount;
    }

    public void setToAccount(String toAccount) {
        this.toAccount = toAccount;
    }

    public String getToAccount() {
        return toAccount;
    }

    public void setMsgSeq(Long msgSeq) {
        this.msgSeq = msgSeq;
    }

    public Long getMsgSeq() {
        return msgSeq;
    }

    public void setMsgRandom(Long msgRandom) {
        this.msgRandom = msgRandom;
    }

    public Long getMsgRandom() {
        return msgRandom;
    }

    public void setMsgTime(Long msgTime) {
        this.msgTime = msgTime;
    }

    public Long getMsgTime() {
        return msgTime;
    }

    public void setMsgKey(String msgKey) {
        this.msgKey = msgKey;
    }

    public String getMsgKey() {
        return msgKey;
    }

    public void setOnlineOnlyFlag(Long onlineOnlyFlag) {
        this.onlineOnlyFlag = onlineOnlyFlag;
    }

    public Long getOnlineOnlyFlag() {
        return onlineOnlyFlag;
    }

    public void setSendMsgResult(Long sendMsgResult) {
        this.sendMsgResult = sendMsgResult;
    }

    public Long getSendMsgResult() {
        return sendMsgResult;
    }

    public void setErrorInfo(String errorInfo) {
        this.errorInfo = errorInfo;
    }

    public String getErrorInfo() {
        return errorInfo;
    }

    public void setUnreadMsgNum(Long unreadMsgNum) {
        this.unreadMsgNum = unreadMsgNum;
    }

    public Long getUnreadMsgNum() {
        return unreadMsgNum;
    }

    public void setMsgBody(String msgBody) {
        this.msgBody = msgBody;
    }

    public String getMsgBody() {
        return msgBody;
    }

    public void setCloudCustomData(String cloudCustomData) {
        this.cloudCustomData = cloudCustomData;
    }

    public String getCloudCustomData() {
        return cloudCustomData;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("createTime", getCreateTime())
                .append("state", getState())
                .append("callbackCommand", getCallbackCommand())
                .append("fromAccount", getFromAccount())
                .append("toAccount", getToAccount())
                .append("msgSeq", getMsgSeq())
                .append("msgRandom", getMsgRandom())
                .append("msgTime", getMsgTime())
                .append("msgKey", getMsgKey())
                .append("onlineOnlyFlag", getOnlineOnlyFlag())
                .append("sendMsgResult", getSendMsgResult())
                .append("errorInfo", getErrorInfo())
                .append("unreadMsgNum", getUnreadMsgNum())
                .append("msgBody", getMsgBody())
                .append("cloudCustomData", getCloudCustomData())
                .toString();
    }
}
